package com.runvp.common.util.enc.aes128gcm;

import javax.crypto.Cipher;
import java.security.Provider;
import java.security.Security;

public class JCECheck {
    public static void main(String[] args) {
        try {
            // 输出JCE版本
            System.out.println("JCE Version: " + Security.getProvider("SunJCE").getVersion());

            // 检查是否支持特定的加密算法，例如AES
            if (Cipher.getMaxAllowedKeyLength("AES") > 128) {
                System.out.println("AES is supported with a key length greater than 128 bits.");
            } else {
                System.out.println("AES is not supported or the key length is limited to 128 bits.");
            }

            // 输出所有安全提供者
            for (Provider provider : Security.getProviders()) {
                System.out.println("Provider: " + provider.getName() + " Version: " + provider.getVersion());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
